Kiva.org is an online crowdfunding platform used to extend financial services to financially excluded people around the world. Kiva lenders have provided over $1 billion dollars in loans to over 2 million people. To effectively set investment priorities, assist lenders, and gain insights into their target communities, the organization needs to comprehend the dynamics across the various countries in which it operates.
1.Borrowers submit loan applications through local field partners (local organizations collaborating with Kiva).
2.Local field partners submit the loan details into the platform.
3.Loan details undergo verification, editing, and translation into different languages.
4.Loans are posted on Kiva for lenders to support.
5.Lenders fund loans in increments of $25 or more through crowdfunding.
6.Once the target amount is reached, the funds are disbursed via field partners, who distribute them to the borrowers.
7.Borrowers repay loans based on agreed-upon intervals and schedules.
8.Lenders utilize repayments to fund new loans, make donations, or withdraw funds.
Conduct a comprehensive analysis of Kiva's operations in a country of your choice using a data analysis tool of your preference.
id - Unique ID for loan
funded_amount - The amount disbursed by Kiva to the field agent(USD)
loan_amount - The amount disbursed by the field agent to the borrower(USD)
activity - More granular category
sector - High level category
use - Exact usage of loan amount
country_code - ISO country code of country in which loan was disbursed
country - Full country name of country in which loan was disbursed
region - Full region name within the country
currency - The currency in which the loan was disbursed
partner_id - ID of partner organization
posted_time - The time at which the loan is posted on Kiva by the field agent
disbursed_time - The time at which the loan is disbursed by the field agent to the borrower
funded_time - The time at which the loan posted to Kiva gets funded by lenders completely
term_in_months - The duration for which the loan was disbursed in months
lender_count - The total number of lenders that contributed to this loan
tags - A term assigned to a loan which helps describe it.
borrower_genders - Comma separated M,F letters, where each instance represents a single male/female in the group
repayment_interval - the periods for which payments are received
date - date the loan is posted on Kiva
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (10, 6)
import seaborn as sns
import plotly.express as px
kiva = pd.read_csv("kiva_loans.csv")
mpi_region = pd.read_csv("kiva_mpi_region_locations.csv")
loan_themeid = pd.read_csv("loan_theme_ids.csv")
loan_themes_region = pd.read_csv("loan_themes_by_region.csv")
#check for missing values from the dataframes.
kiva.isna()
mpi_region.isna()
loan_themeid.isna()
loan_themes_region.isna()
| Partner ID | Field Partner Name | sector | Loan Theme ID | Loan Theme Type | country | forkiva | region | geocode_old | ISO | ... | amount | LocationName | geocode | names | geo | lat | lon | mpi_region | mpi_geo | rural_pct | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | False | False | False | False | False | False | False | False | False | False | ... | False | False | False | False | False | False | False | False | False | False |
| 1 | False | False | False | False | False | False | False | False | True | False | ... | False | False | False | False | False | False | False | False | False | False |
| 2 | False | False | False | False | False | False | False | False | True | False | ... | False | False | False | False | False | False | False | False | False | False |
| 3 | False | False | False | False | False | False | False | False | False | False | ... | False | False | False | False | False | False | False | False | False | False |
| 4 | False | False | False | False | False | False | False | False | False | False | ... | False | False | False | False | False | False | False | False | False | False |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 15731 | False | False | False | False | False | False | False | False | True | False | ... | False | False | False | False | False | False | False | False | True | True |
| 15732 | False | False | False | False | False | False | False | False | False | False | ... | False | False | False | False | False | False | False | False | False | True |
| 15733 | False | False | False | False | False | False | False | False | False | False | ... | False | False | False | False | False | False | False | False | False | True |
| 15734 | False | False | False | False | False | False | False | False | True | False | ... | False | False | False | False | False | False | False | False | True | True |
| 15735 | False | False | False | False | False | False | False | False | True | False | ... | False | False | False | False | False | False | False | False | False | True |
15736 rows × 21 columns
kiva.isna()
| id | funded_amount | loan_amount | activity | sector | use | country_code | country | region | currency | partner_id | posted_time | disbursed_time | funded_time | term_in_months | lender_count | tags | borrower_genders | repayment_interval | date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | True | False | False | False |
| 1 | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | True | False | False | False |
| 2 | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False |
| 3 | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | True | False | False | False |
| 4 | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | False | True | False | False | False |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 671200 | False | False | False | False | False | False | False | False | False | False | False | False | False | True | False | False | True | False | False | False |
| 671201 | False | False | False | False | False | False | False | False | True | False | False | False | False | False | False | False | True | False | False | False |
| 671202 | False | False | False | False | False | True | False | False | True | False | False | False | False | True | False | False | True | True | False | False |
| 671203 | False | False | False | False | False | False | False | False | True | False | False | False | False | True | False | False | True | False | False | False |
| 671204 | False | False | False | False | False | False | False | False | True | False | False | False | False | True | False | False | True | False | False | False |
671205 rows × 20 columns
kiva.tail(10)
| id | funded_amount | loan_amount | activity | sector | use | country_code | country | region | currency | partner_id | posted_time | disbursed_time | funded_time | term_in_months | lender_count | tags | borrower_genders | repayment_interval | date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 671195 | 1340329 | 0.0 | 50.0 | Livestock | Agriculture | Edited loan use in english. | GH | Ghana | Dansoman | GHS | 231.0 | 2017-07-25 22:40:59+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female, female | monthly | 2017-07-25 |
| 671196 | 1340325 | 0.0 | 250.0 | Livestock | Agriculture | Reviewed loan use in english. | GH | Ghana | Dansoman | GHS | 231.0 | 2017-07-25 21:36:20+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-25 |
| 671197 | 1340330 | 0.0 | 25.0 | Livestock | Agriculture | Pretend the issue with loan got addressed by K... | KE | Kenya | NaN | KES | 138.0 | 2017-07-25 22:55:42+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-25 |
| 671198 | 1340331 | 0.0 | 75.0 | Livestock | Agriculture | Pretend the issue with spanish loan was addres... | MX | Mexico | Iztacalco | MXN | 294.0 | 2017-07-25 23:13:50+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-25 |
| 671199 | 1340318 | 0.0 | 25.0 | Livestock | Agriculture | [True, u'para compara: cemento, arenya y ladri... | PY | Paraguay | Concepción | USD | 58.0 | 2017-07-25 06:45:02+00:00 | 2017-07-24 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-25 |
| 671200 | 1340323 | 0.0 | 25.0 | Livestock | Agriculture | [True, u'para compara: cemento, arenya y ladri... | PY | Paraguay | Concepción | USD | 58.0 | 2017-07-25 16:55:34+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-25 |
| 671201 | 1340316 | 25.0 | 25.0 | Livestock | Agriculture | [True, u'to start a turducken farm.'] - this l... | KE | Kenya | NaN | KES | 138.0 | 2017-07-25 06:14:08+00:00 | 2017-07-24 07:00:00+00:00 | 2017-07-26 02:09:43+00:00 | 13.0 | 1 | NaN | female | monthly | 2017-07-25 |
| 671202 | 1340334 | 0.0 | 25.0 | Games | Entertainment | NaN | KE | Kenya | NaN | KES | 138.0 | 2017-07-26 00:02:07+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | NaN | monthly | 2017-07-26 |
| 671203 | 1340338 | 0.0 | 25.0 | Livestock | Agriculture | [True, u'to start a turducken farm.'] - this l... | KE | Kenya | NaN | KES | 138.0 | 2017-07-26 06:12:55+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-26 |
| 671204 | 1340339 | 0.0 | 25.0 | Livestock | Agriculture | [True, u'to start a turducken farm.'] - this l... | KE | Kenya | NaN | KES | 138.0 | 2017-07-26 06:31:46+00:00 | 2017-07-25 07:00:00+00:00 | NaN | 13.0 | 0 | NaN | female | monthly | 2017-07-26 |
mpi_region.isna().tail(10)
| LocationName | ISO | country | region | world_region | MPI | geo | lat | lon | |
|---|---|---|---|---|---|---|---|---|---|
| 2762 | True | True | True | True | True | True | False | True | True |
| 2763 | True | True | True | True | True | True | False | True | True |
| 2764 | True | True | True | True | True | True | False | True | True |
| 2765 | True | True | True | True | True | True | False | True | True |
| 2766 | True | True | True | True | True | True | False | True | True |
| 2767 | True | True | True | True | True | True | False | True | True |
| 2768 | True | True | True | True | True | True | False | True | True |
| 2769 | True | True | True | True | True | True | False | True | True |
| 2770 | True | True | True | True | True | True | False | True | True |
| 2771 | True | True | True | True | True | True | False | True | True |
cleaned_data = [kiva,mpi_region,loan_themeid,loan_themes_region]
for x in cleaned_data:
missing_values = x.dropna(inplace = True)
kiva.tail(10)
| id | funded_amount | loan_amount | activity | sector | use | country_code | country | region | currency | partner_id | posted_time | disbursed_time | funded_time | term_in_months | lender_count | tags | borrower_genders | repayment_interval | date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 671006 | 1338429 | 400.0 | 400.0 | Fruits & Vegetables | Food | to buy more vegetables to sell, in order to ha... | SV | El Salvador | San Miguel | USD | 199.0 | 2017-07-12 15:48:37+00:00 | 2017-07-06 07:00:00+00:00 | 2017-07-14 15:47:04+00:00 | 14.0 | 9 | volunteer_pick, #Single Parent, #Parent, #Repe... | female | monthly | 2017-07-12 |
| 671084 | 1338347 | 300.0 | 300.0 | Natural Medicines | Health | to buy more nutritional supplements to keep se... | SV | El Salvador | San Miguel | USD | 199.0 | 2017-07-12 14:25:23+00:00 | 2017-06-30 07:00:00+00:00 | 2017-07-15 14:21:03+00:00 | 9.0 | 7 | #Health and Sanitation | male | irregular | 2017-07-12 |
| 671093 | 1338648 | 1300.0 | 1300.0 | Retail | Retail | to buy perfumes, creams, lotions, etc. | EC | Ecuador | Portoviejo | USD | 137.0 | 2017-07-12 22:53:22+00:00 | 2017-06-30 07:00:00+00:00 | 2017-07-15 15:50:13+00:00 | 7.0 | 4 | #Parent, #Woman Owned Biz, #Repeat Borrower | female | monthly | 2017-07-12 |
| 671097 | 1338653 | 500.0 | 500.0 | Crafts | Arts | to buy thread to make hammocks. | SV | El Salvador | Gotera | USD | 199.0 | 2017-07-12 23:16:52+00:00 | 2017-06-12 07:00:00+00:00 | 2017-07-15 23:29:36+00:00 | 12.0 | 9 | #Fabrics, user_favorite, user_favorite | female | bullet | 2017-07-12 |
| 671105 | 1338792 | 2600.0 | 2600.0 | Food Production/Sales | Food | to buy supplies for making cheese buns [chipas... | PY | Paraguay | Paraguari | PYG | 58.0 | 2017-07-13 03:06:02+00:00 | 2017-06-13 07:00:00+00:00 | 2017-07-15 21:41:13+00:00 | 6.0 | 13 | #Woman Owned Biz | female, female, female, female, female, female... | irregular | 2017-07-13 |
| 671107 | 1338832 | 350.0 | 350.0 | Personal Medical Expenses | Health | to pay for her husband's operation and hospita... | TJ | Tajikistan | Isfara | TJS | 63.0 | 2017-07-13 04:38:24+00:00 | 2017-07-12 07:00:00+00:00 | 2017-07-14 16:36:03+00:00 | 14.0 | 9 | volunteer_like, #Health and Sanitation | female | monthly | 2017-07-13 |
| 671110 | 1338784 | 2700.0 | 2700.0 | Perfumes | Retail | to buy a range of clothing and perfumes to sell. | PY | Paraguay | Ita | PYG | 58.0 | 2017-07-13 02:54:56+00:00 | 2017-06-13 07:00:00+00:00 | 2017-07-15 20:23:53+00:00 | 5.0 | 21 | #Woman Owned Biz | female, female, female, female, female, female... | irregular | 2017-07-13 |
| 671133 | 1338878 | 475.0 | 475.0 | Higher education costs | Education | to pay her son's tuition. | TJ | Tajikistan | Dushanbe | TJS | 63.0 | 2017-07-13 06:38:39+00:00 | 2017-07-11 07:00:00+00:00 | 2017-07-16 04:29:11+00:00 | 14.0 | 12 | #Schooling, #Parent | female | monthly | 2017-07-13 |
| 671134 | 1338682 | 3525.0 | 3525.0 | Grocery Store | Food | to buy drinks, baked goods, greens, meat, vege... | PY | Paraguay | Ciudad del Este | PYG | 58.0 | 2017-07-13 00:31:11+00:00 | 2017-06-13 07:00:00+00:00 | 2017-07-15 17:44:19+00:00 | 5.0 | 16 | #Woman Owned Biz | female, female, female, female, female, female... | irregular | 2017-07-13 |
| 671141 | 1339713 | 175.0 | 175.0 | Sewing | Services | to purchase of a digital sewing machine for em... | TJ | Tajikistan | Hamadoni | TJS | 63.0 | 2017-07-14 05:27:46+00:00 | 2017-07-05 07:00:00+00:00 | 2017-07-14 19:10:26+00:00 | 14.0 | 5 | #Biz Durable Asset, #Fabrics | female | monthly | 2017-07-14 |
region = kiva.groupby("region")["loan_amount"].sum().sort_values(ascending = False).head(10)
fig = px.bar(region,y="loan_amount",color_discrete_sequence = ["blue"])
fig.update_layout(
title = "Loan Amount by Region",
title_x = 0.5,)
fig.show()
Goma,North Kivu Province was the region with the highest loan amount.
kiva[["borrower_genders"]]
| borrower_genders | |
|---|---|
| 2 | female |
| 6 | female |
| 7 | female |
| 8 | female |
| 12 | female |
| ... | ... |
| 671107 | female |
| 671110 | female, female, female, female, female, female... |
| 671133 | female |
| 671134 | female, female, female, female, female, female... |
| 671141 | female |
423081 rows × 1 columns
kiva['borrower_genders'] = kiva['borrower_genders'].str.split(', ')
kiva = kiva.explode('borrower_genders', ignore_index=True)
kiva[["borrower_genders"]]
| borrower_genders | |
|---|---|
| 0 | female |
| 1 | female |
| 2 | female |
| 3 | female |
| 4 | female |
| ... | ... |
| 879358 | female |
| 879359 | female |
| 879360 | female |
| 879361 | female |
| 879362 | female |
879363 rows × 1 columns
fig = px.pie(kiva, values ="loan_amount", names= "borrower_genders")
fig.update_layout(
title = "Loan Amount by Gender",
title_x = 0.5,)
fig.show()